<!DOCTYPE html>
<html class="x-admin-sm">

{include file="common/static" /}
{include file="common/resources" /}
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">演示</a>
                <a>
                    <cite>导航元素</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
        <div class="layui-fluid" id="a2">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <table class="layui-table layui-form">
                                <thead>
                                    <tr>
                                        <th>房间号</th>
                                        <th>房间类型</th>
                                        <th>预设单价</th>
                                        <th>押金</th>
                                        <th>折扣</th>
                                        <th>折后价</th>
                                </thead>
                                <tbody>
                                {volist name="list" id="vo"}
                                    <tr>
                                        <td>{$vo.room_num}</td>
                                        <td>{$vo.type_name}</td>
                                        <td>{$vo.price}￥</td>
                                        <td>{$vo.deposit}￥</td>
                                        <td>{$vo.name}:{$vo.a_price}</td>
                                        <td>{$vo.price * $vo.a_price}￥</td>
                                    </tr>
                                {/volist}

                                {volist name="follow" id="v"}
                                <tr>
                                    <td>{$v.room_num}</td>
                                    <td>{$v.type_name}</td>
                                    <td>{$v.price}￥</td>
                                    <td>{$v.deposit}￥</td>
                                    <td></td>
                                    <td>{$v.price * $vo.a_price}￥</td>
                                </tr>
                                {/volist}

                                <tr>
                                    <td>合计</td>
                                    <td></td>
                                    <td>{$list[0]['price'] + $price}￥</td>
                                    <td>{$list[0]['deposit'] + $deposit}￥</td>
                                    <td></td>
                                    <!--<td>总共需要：{$list[0]['deposit'] + $list[0]['price']*$list[0]['a_price']}￥</td>-->
                                    <td>总共需要：<?php echo ($list[0]['price'] + $price) * $list[0]['a_price'] +  $list[0]['deposit'] + $deposit ?>￥</td>
                                </tr>
                                </tbody>
                            </table>
                            <hr class="layui-bg-black">
                            <div class="layui-container">

                                <div class="layui-row">
                                    <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
                                        <p>宾客姓名：{$list[0]['guest_name']}</p>
                                        <p>证件号码：{$list[0]['credentials']}</p>
                                    </div>
                                    <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
                                        <p>性别：{$list[0]['guest_sex']}</p>
                                        <p>押金：{$list[0]['deposit']}</p>
                                    </div>
                                    <div class="layui-col-xs4 layui-col-sm12 layui-col-md4">
                                        <p>促销活动：{$list[0]['name']}</p>
                                        <p>付款方式：{$list[0]['payment_id']}</p>
                                        <p>宾客签字：xxx</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <button class="layui-btn"  id="aa">
            <i class="layui-icon"></i>打印票据
        </button>
    </body>

<script>layui.use(['laydate', 'form'],
        function() {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });
    $(document).ready(function(){
        $("#aa").click(function(){
            $("#a2").printArea();
        });
    });
</script>


</html>